<template>
  <el-form-item :label="label" :prop="prop">
<!--    <div class="el-border">-->
<!--      -->
<!--    </div>-->
    <el-switch
        v-model="newv"
        :active-text="trueText"
        :disabled="disabled"
        :inactive-text="falseText"
    ></el-switch>
  </el-form-item>
</template>
<script setup>
import { computed } from "vue";
const props = defineProps({
  modelValue: [Boolean, String, Number],
  label: {
    type: String,
    default: "",
  },
  prop: {
    type: String,
    default: "",
  },
  disabled: {
    type: Boolean,
    default: false,
  },
  trueText: {
    type: String,
    default: "是",
  },
  falseText: {
    type: String,
    default: "否",
  },
});
const emit = defineEmits(["update:modelValue"]);

const newv = computed({
  get() {
    return props.modelValue;
  },
  set(value) {
    emit("update:modelValue", value);
  },
});
</script>
